package com.dubbo.mapper;

import com.dubbo.domain.Banner;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;
import java.util.Map;

/**
 * 广告mapper
 * @author chenluqiang
 * @date 2018年12月27日 下午3:11:57 
 *
 */
public interface BannerMapper extends Mapper<Banner>{

	/**
	 * 获取首页图片
	 * @author wujunyuan
	 * @date 2018年12月27日  下午3:15:22
	 * @param type 0=引导图 1=轮播图 2=图标
	 * @return
	 */
	@Select("SELECT " + 
			"   bbr.id AS bannerId, "+
			"	bbr.title, " + 
			"	bbr.pic, " + 
			"	bbr.seat, " + 
			"  bbr.articleId " + 
			"FROM " + 
			"	b_banner bbr " + 
			"WHERE " + 
			"	bbr.type = #{type}"+
			" ORDER BY bbr.seat")
	List<Map<String, Object>> getBannerPic(@Param("type") Integer type);
	
}